<div id="content">

    <? if(is_array($response)){?>
    <div class="response">
        <span class="<?=$response["class"]?>"><?=$response["msg"]?></span>
    </div>
    <?}?>

    <a class="button" href="<?=site_url('admin/faq/add')?>" style="float:right">ADD NEW FAQ</a>
    <h1>Frequently Asked Questions</h1>

    <div class="live_search_msg"></div>    
    <? foreach($list as $item){ 
        $class = ($item['Approved_FAQs']!=1)?'unapproved':(($item['Active_FAQs']=='1')?'active':'inactive');
    ?>

        <div class="list_block search  <?=$class?>">     
            <a class="title" href="<?=site_url('admin/faq/preview/'.$item['id_FAQs'])?>" rel="view">
                    <?=$item['Title_FAQs']?>
            </a>

            <div class="buttons_block">
            <a href="<?=site_url('admin/faq/edit/'.$item['id_FAQs'])?>" class="button">edit</a>
            <? if($item['Approved_FAQs']==1) { ?>
                <? if ($item['Active_FAQs'] == 1){ ?>            
                <a href="<?=site_url('admin/faq/deactivate/'.$item['id_FAQs'])?>" class="button">deactivate</a>
                <? } else { ?> 
                <a href="<?=site_url('admin/faq/activate/'.$item['id_FAQs'])?>" class="button">activate</a>
                <? } ?>
            <? } else if(is_allowed(array(ROLE_ADMIN,ROLE_PUBLISHER))){ ?>
                <a href="<?=site_url('admin/faq/approve/'.$item['id_FAQs'])?>" class="button">approve</a>
            <? } ?>
            <a href="<?=site_url('admin/faq/remove/'.$item['id_FAQs'])?>" class="button">delete</a>
            </div>

        </div>

    <? } ?>

</div>